package com.moleq.models;

import com.moleq.db.DatabaseSchema;


public class Departmant {
//	CREATE TABLE t_department_setting
//	(F03 numeric(4,0) NOT NULL,
//	dep_name varchar(50) NOT NULL,
//	F81 varchar(1) DEFAULT '0' NOT NULL,
//	F79 varchar(1) DEFAULT '0' NOT NULL,
//	create_datetime varchar(14) NULL,
//	update_datetime varchar(14) NULL,
//	PRIMARY KEY (F03));
	
	private int dep_no; //F03
	private String dep_name; //dep_name
	private boolean food_stamp; //F79
	private boolean tax1; //F81
	private boolean tax2; //F96
	private boolean tax3; //F97
	private boolean tax4; //F98
	private boolean tax5; //F99
	private boolean tax6; //F100
	private boolean scale_weight; //F82
	private String wic; //F178
	private boolean no_discnt; //F150
	private String cvv; //F924
	private int group_no; //F263
	private int age;
	private String create_datetime;
	private String update_datetime;
	private String age_desc;
	

	public Departmant(){}
	public Departmant(int dep_no,String dep_name,boolean food_stamp,boolean tax1,boolean tax2,boolean tax3,boolean tax4,boolean tax5,boolean tax6
			,boolean scale_weight,String wic,boolean no_discnt,String cvv,int group_no,int age,String create_datetime,String update_datetime){
		this.dep_no = dep_no;
		this.dep_name = dep_name;
		this.food_stamp = food_stamp;
		this.tax1 = tax1;
		this.tax2 = tax2;
		this.tax3 = tax3;
		this.tax4 = tax4;
		this.tax5 = tax5;
		this.tax6 = tax6;
		this.scale_weight = scale_weight;
		this.wic = wic;
		this.no_discnt = no_discnt;
		this.cvv = cvv;
		this.group_no = group_no;
		this.age = age;
		this.create_datetime = create_datetime;
		this.update_datetime = update_datetime;
	}
	
	public Departmant(int dep_no,String dep_name,boolean food_stamp,boolean tax1,boolean tax2,boolean tax3,boolean tax4,boolean tax5,boolean tax6
			,boolean scale_weight,String wic,boolean no_discnt,String cvv,int group_no,int age,String age_desc){
		this.dep_no = dep_no;
		this.dep_name = dep_name;
		this.food_stamp = food_stamp;
		this.tax1 = tax1;
		this.tax2 = tax2;
		this.tax3 = tax3;
		this.tax4 = tax4;
		this.tax5 = tax5;
		this.tax6 = tax6;
		this.scale_weight = scale_weight;
		this.wic = wic;
		this.no_discnt = no_discnt;
		this.cvv = cvv;
		this.group_no = group_no;
		this.age = age;
		this.age_desc = age_desc;
	}
	
	public String getCreate_datetime() {
		return create_datetime;
	}
	public void setCreate_datetime(String create_datetime) {
		this.create_datetime = create_datetime;
	}
	public String getUpdate_datetime() {
		return update_datetime;
	}
	public void setUpdate_datetime(String update_datetime) {
		this.update_datetime = update_datetime;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	public int getDep_no() {
		return dep_no;
	}
	public void setDep_no(int dep_no) {
		this.dep_no = dep_no;
	}
	public String getDep_name() {
		return dep_name;
	}
	public void setDep_name(String dep_name) {
		this.dep_name = dep_name;
	}
	public boolean getFood_stamp() {
		return food_stamp;
	}
	public void setFood_stamp(boolean food_stamp) {
		this.food_stamp = food_stamp;
	}
	public boolean getTax1() {
		return tax1;
	}
	public void setTax1(boolean tax1) {
		this.tax1 = tax1;
	}
	public boolean getTax2() {
		return tax2;
	}
	public void setTax2(boolean tax2) {
		this.tax2 = tax2;
	}
	public boolean getTax3() {
		return tax3;
	}
	public void setTax3(boolean tax3) {
		this.tax3 = tax3;
	}
	public boolean getTax4() {
		return tax4;
	}
	public void setTax4(boolean tax4) {
		this.tax4 = tax4;
	}
	public boolean getTax5() {
		return tax5;
	}
	public void setTax5(boolean tax5) {
		this.tax5 = tax5;
	}
	public boolean getTax6() {
		return tax6;
	}
	public void setTax6(boolean tax6) {
		this.tax6 = tax6;
	}
	public boolean getScale_weight() {
		return scale_weight;
	}
	public void setScale_weight(boolean scale_weight) {
		this.scale_weight = scale_weight;
	}
	public String getWic() {
		return wic;
	}
	public void setWic(String wic) {
		this.wic = wic;
	}
	public boolean getNo_discnt() {
		return no_discnt;
	}
	public void setNo_discnt(boolean no_discnt) {
		this.no_discnt = no_discnt;
	}
	public String getCvv() {
		return cvv;
	}
	public void setCvv(String cvv) {
		this.cvv = cvv;
	}
	public int getGroup_no() {
		return group_no;
	}
	public void setGroup_no(int group_no) {
		this.group_no = group_no;
	}
	
	public String getAge_desc() {
		return age_desc;
	}
	public void setAge_desc(String age_desc) {
		this.age_desc = age_desc;
	}

	
	public String toMGData(String Action){
		String ls_tax1 = getTax1()?"1":"0";
		String ls_tax2 = getTax2()?"1":"0";
		String ls_tax3 = getTax3()?"1":"0";
		String ls_tax4 = getTax4()?"1":"0";
		String ls_tax5 = getTax5()?"1":"0";
		String ls_tax6 = getTax6()?"1":"0";
		String ls_fs = getFood_stamp()?"1":"0";
		String ls_scale_weight = getScale_weight()?"1":"0";
		String ls_no_discount = getNo_discnt()?"1":"0";
		
		
		String Result = Action + "|" + DatabaseSchema.DepartmentSetting.SCHEMA_NAME + "|(" + getDep_no() + "," + CheckNull(getDep_name())
				+ "," + CheckNull(ls_tax1) + "," + CheckNull(ls_fs)+ ","
				+ CheckNull(getCreate_datetime()) + "," + CheckNull(getUpdate_datetime()) + ","
				+ CheckNull(ls_tax2) + "," + CheckNull(ls_tax3) + "," + CheckNull(ls_tax4)
				+ "," + CheckNull(ls_scale_weight) + "," + CheckNull(getWic()) + ","
				+ CheckNull(ls_no_discount) + "," + CheckNull(getCvv()) + "," + getGroup_no() + ","
				+ getAge() + "," + CheckNull(ls_tax5) + ","
				+ CheckNull(ls_tax6) + ")";
		return Result;
	}
	
	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}
	public boolean isWic() {
		// TODO Auto-generated method stub
		if (wic.equals("1")) {
			return true;
		}
		return false;
	}
	public boolean isCvv() {
		// TODO Auto-generated method stub
		if (cvv.equals("1")) {
			return true;
		}
		return false;
	}
}
